package shayu.member.web;

import cn.hutool.crypto.Mode;
import io.renren.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import shayu.member.fengin.OrderFeign;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

@Controller
public class MemberWebController {

    @Autowired
    OrderFeign orderFeign;

    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",required = false,defaultValue ="0") Integer pageNum, Model model, HttpServletRequest request){

        // 查看当前登录的用户所有订单列表数据
        HashMap<String, Object> page = new HashMap<>();
        page.put("page",pageNum.toString());

        R r = orderFeign.listWithItem(page);
        model.addAttribute("orders",r);
        return "orderList";
    }


}
